Imports WindowsLive.Writer.Api

Public Class Settings
  Private _Settings As IProperties
  Private _FlickrAuthToken As String
  Private _ZooomrAuthToken As String
  Private _TwentyThreeHQAuthToken As String
  Private _LastServiceUsed As SupportedServiceList = SupportedServiceList.Flickr

  Private _LastFolderUsed As String = My.Computer.FileSystem.SpecialDirectories.MyPictures

  Private Const PROPERTYKEY_FlickrAuthToken = "PicturePostFlickrAuthToken"
  Private Const PROPERTYKEY_ZooomrAuthToken = "PicturePostZoomrAuthToken"
  Private Const PROPERTYKEY_TwentyThreeHQAuthToken = "PicturePostTwentyThreeHQAuthToken"
  Private Const PROPERTYKEY_LastServiceUsed = "PicturePostLastServiceUsed"
  Private Const PROPERTYKEY_LastFolderUsed = "PicturePostLastFolderUsed"

  Public Enum SupportedServiceList
    Flickr = 0
    TwentyThreeHQ = 1
  End Enum

  Public Sub New(ByVal settings As IProperties)
    _Settings = settings

  End Sub

  Public Property CurrentPhotoService() As SupportedServiceList
    Get
      Return _Settings.GetString(PROPERTYKEY_LastServiceUsed, _LastServiceUsed)
    End Get
    Set(ByVal value As SupportedServiceList)
      _Settings.SetString(PROPERTYKEY_LastServiceUsed, value)
    End Set
  End Property

  Public Property FlickrAuthToken() As String
    Get
      Return _Settings.GetString(PROPERTYKEY_FlickrAuthToken, _FlickrAuthToken)
    End Get
    Set(ByVal value As String)
      _Settings.SetString(PROPERTYKEY_FlickrAuthToken, value)
    End Set
  End Property

  Public Property ZooomrAuthToken() As String
    Get
      Return _Settings.GetString(PROPERTYKEY_ZooomrAuthToken, _ZooomrAuthToken)
    End Get
    Set(ByVal value As String)
      _Settings.SetString(PROPERTYKEY_ZooomrAuthToken, value)
    End Set
  End Property

  Public Property TwentyThreeHQAuthToken() As String
    Get
      Return _Settings.GetString(PROPERTYKEY_TwentyThreeHQAuthToken, _TwentyThreeHQAuthToken)
    End Get
    Set(ByVal value As String)
      _Settings.SetString(PROPERTYKEY_TwentyThreeHQAuthToken, value)
    End Set
  End Property

  Public Property LastFolderUsed() As String
    Get
      Return _Settings.GetString(PROPERTYKEY_LastFolderUsed, _LastFolderUsed)
    End Get
    Set(ByVal value As String)
      _Settings.SetString(PROPERTYKEY_LastFolderUsed, value)
    End Set
  End Property

End Class
